package com.xyzwps.paimon.furina.modules.tag

import com.xyzwps.paimon.furina.common.value.PageSize
import org.springframework.stereotype.Service

@Service
class TagService(private val tagRepository: TagRepository) {

    fun create(domain: Int, name: String): Tag = tagRepository.create(domain, name)

    fun findByPrefix(domain: Int, prefix: String, size: PageSize): List<Tag> = tagRepository
        .findByPrefix(TagDomain.validDomain(domain), prefix, size)

    fun findByIds(domain: Int, ids: List<Long>): List<Tag> = tagRepository.findByIds(domain, ids)
}